package models

//写该层用到的结构体（只写和数据库对应的结构体）；其他拆分结构体或自建结构体写到dto中

import "time"

// User 用户结构体
type User struct {
	UserID           uint       `gorm:"primaryKey;autoIncrement" json:"user_id"`
	UserName         string     `gorm:"type:varchar(20);uniqueIndex;not null" json:"user_name"`
	Password         string     `gorm:"type:varchar(20);not null" json:"-"`
	Salt             string     `gorm:"type:varchar(20);not null" json:"-"`
	Sex              int        `gorm:"type:int;default:3" json:"sex"`
	Avatar           string     `gorm:"type:varchar(255)" json:"avatar"`
	Phone            string     `gorm:"type:varchar(11)" json:"phone"`
	UserStatus       int        `gorm:"type:int;default:1" json:"user_status"`
	Signature        string     `gorm:"type:varchar(255)" json:"signature"`
	FansCount        int        `gorm:"type:int;default:0" json:"fans_count"`
	FollowersCount   int        `gorm:"type:int;default:0" json:"followers_count"`
	PostsCount       int        `gorm:"type:int;default:0" json:"posts_count"`
	CollectionsCount int        `gorm:"type:int;default:0" json:"collections_count"`
	Email            string     `gorm:"type:varchar(25)" json:"email"`
	Age              int        `gorm:"type:int" json:"age"`
	ViolationCount   int        `gorm:"type:int;default:0" json:"violation_count"`
	Province         string     `gorm:"type:varchar(50)" json:"province"`
	City             string     `gorm:"type:varchar(20)" json:"city"`
	IPAddress        string     `gorm:"type:varchar(25)" json:"ip_address"`
	Permission       int        `gorm:"type:int" json:"permission"`
	LoginTime        *time.Time `gorm:"type:datetime" json:"login_time"`
	CreateTime       time.Time  `gorm:"type:datetime;autoCreateTime" json:"create_time"`
	DeleteTime       *time.Time `gorm:"type:datetime" json:"delete_time"`
	UpdateTime       time.Time  `gorm:"type:datetime;autoUpdateTime" json:"update_time"`
}
